package com.dz.finance.biz.config;


import com.dz.finance.biz.entity.Member;
import com.dz.finance.biz.entity.SysMenu;
import com.dz.finance.biz.vo.CurrentInfoVo;
import com.dz.finance.biz.vo.GenerateMpRegCodeVo;
import com.dz.finance.biz.vo.ListTreeMenuVo;
import com.dz.finance.wechat.entity.MpQrCodeCreateResp;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface ObjectConvertor {

    GenerateMpRegCodeVo toGenerateMpRegCodeVo(MpQrCodeCreateResp resp);

    @Mappings({@Mapping(target = "avatar", source = "avatarUrl")})
    CurrentInfoVo toCurrentInfoVo(Member source);

    @Mapping(target = "title",source = "name")
    // TODO 映射有问题
    List<ListTreeMenuVo> toTreeMenuVo(List<SysMenu> list);

    ListTreeMenuVo toListTreeMenuVo(SysMenu o);
}
